<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>机构活动列表</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__swiper.min.css">
    <link rel="stylesheet" type="text/css" href="__CSS__dropload.css"/>
    <style>
        .aui-bar-nav .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.75rem;
            color: #E73C5C;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-bar-nav {
            background: linear-gradient(to left, #D4474B 0, #C13A32 50%);
            background: -webkit-linear-gradient(to left, #D4474B 0, #C13A32 50%);
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left_white.png') no-repeat 0.5rem center;
            background-size: 22px 22px;
        }

        .aui-bar-nav .aui-pull-right {
            padding-right: 0.75rem;
        }

        .aui-bar-nav .aui-title {
            font-size: 0.9rem;
            color: #333333;
            font-weight: 500;
        }

        body {
            background: #f5f5f5;

        }

        .head {
            width: 100%;
            height: 4rem;
            background: linear-gradient(to left, #D4474B 0, #C13A32 50%);
            background: -webkit-linear-gradient(to left, #D4474B 0, #C13A32 50%);
        }

        .info {
            width: 100%;
            height: 9.5rem;
            background: #fff;
            padding: 2.4rem 0.7rem 0.9rem 0.7rem;
            margin-bottom: 0.5rem;
            position: relative;
        }

        .logo {
            width: 4.5rem;
            height: 4.5rem;
            line-height: 4.5rem;
            border-radius: 50%;
            background: rgba(255, 255, 255, 1);
            box-shadow: 0px 1px 6px rgba(230, 227, 227, 1);
            color: #E62938;
            font-size: 0.75rem;
            font-weight: 500;
            text-align: center;
            position: absolute;
            left: 0;
            right: 0;
            top: -120%;
            bottom: 0;
            margin: auto;
            z-index: 2;
            overflow: hidden;
        }

        .yuan {
            width: 6rem;
            height: 6rem;
            border-radius: 50%;
            background: #fff;
            position: absolute;
            left: 0;
            right: 0;
            top: -68%;
            bottom: 0;
            margin: auto;
            z-index: 1;
        }

        .title {
            font-size: 0.8rem;
            color: #333;
            position: absolute;
            top: 2.4rem;
            left: 19.2%;
            font-weight: 500;
            text-align: center;
            z-index: 3;
        }

        .content {
            font-size: 0.75rem;
            color: #666;
            margin-top: 1.8rem;
        }

        .service {
            width: 100%;
            background: #fff;
            padding: 0 0.7rem;
        }

        .serviceInfo {
            height: 2.45rem;
            line-height: 2.45rem;
            font-size: 0.75rem;
            display: flex;
            justify-content: space-between;
        }

        .serviceHour {
            color: #999;
        }

        .serviceData {
            color: #333
        }

        .underLine {
            border: none;
            background-size: 100% 1px;
            background-repeat: no-repeat;
            background-position: bottom;
            background-image: linear-gradient(0, #EDEDED, #EDEDED 50%, transparent 50%);
            background-image: -webkit-linear-gradient(90deg, #EDEDED, #EDEDED 50%, transparent 50%);
        }

        .serviceImg {
            background: #fff;
            padding: 1rem 0 0.75rem 0.7rem;
            margin-bottom: 0.5rem;
        }

        .activityName {
            color: #333;
            font-size: 0.85rem;
            font-weight: 500;
            padding-bottom: 0.75rem;
        }

        .activityName1 {
            color: #333;
            font-size: 0.85rem;
            font-weight: 500;
        }

        .swiper-container {
            width: 100%;
            height: 5.95rem;
        }

        .swiper-slide {
            width: 50%;
            height: 5.95rem;
            margin-right: 0.5rem;
        }

        .swiperImg {
            width: 100%;
            height: 100%;
        }

        .activity {
            padding: 1rem 0.7rem 0 0.7rem;
            background: #fff;
        }

        .activityImg {
            width: 4.825rem;
            height: 4.825rem;
            margin-right: 0.8rem;
            border-radius: 0.25rem;
        }

        .showImg {
            width: 100%;
            height: 100%;
            border-radius: 0.25rem;
        }

        .activityContent {
            height: 4.825rem;
            position: relative;
        }

        .activityTitle {
            color: #333;
            font-size: 0.8rem;
            margin-bottom: 0.2rem;
        }

        .box {
            margin-bottom: 0.25rem;
            height: 0.65rem;
            display: flex;
            align-items: center;
        }

        .destination, .activityTime {
            color: #999;
            font-size: 0.65rem;
        }

        .logo1 {
            width: 0.65rem;
            height: 0.65rem;
            background: url(__IMG__location.png) no-repeat center center;
            background-size: 100% 100%;
            margin-right: 0.2rem;
        }

        .logo2 {
            width: 0.65rem;
            height: 0.65rem;
            background: url(__IMG__clock.png) no-repeat center center;
            background-size: 100% 100%;
            margin-right: 0.2rem;
        }

        .report {
            width: 100%;
            height: 1.95rem;
            position: absolute;
            bottom: 0;
        }

        .reportDetail {
            position: relative;
            color: #ccc;
            font-size: 0.5rem;
            padding: 0.15rem 0.25rem;
            padding-bottom: 0.05rem;
            max-width: 5rem;
            height: 1rem;
            /*display: inline-block;*/
            float: left;
            margin-top: 1.1rem;
        }

        .reportDetail:after {
            width: 198%;
            height: 190%;
            position: absolute;
            top: -48%;
            left: -50%;
            content: "";
            border: 1px solid #E6E6E6;
            border-radius: 0.4rem;
            -ms-transform: scale(0.5);
            /* IE 9 */
            -moz-transform: scale(0.5);
            /* Firefox */
            -webkit-transform: scale(0.5);
            -o-transform: scale(0.5);
            display: -webkit-box;
            overflow: hidden;
            text-overflow: ellipsis;
            word-wrap: break-word;
            word-break: break-all;
            white-space: normal !important;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
        }

        .signUp {
            text-align: right;
            font-size: 0.65rem;
            color: #FFBA71;
            padding-top: 1.1rem;
            float: right
        }

        .xian {
            width: 0.75rem;
            height: 0.75rem;

            display: inline-block;
            vertical-align: middle;
        }

        .moreActivity {
            width: 100%;
            height: 2.7rem;
            line-height: 2.7rem;
            color: #999;
            font-size: 0.7rem;
            text-align: center;
        }

        .juli {
            margin-bottom: 0.5rem;
        }

        .activityDetails {
            padding: 0.75rem 0.55rem 0.75rem 0;
        }
    </style>
</head>

<body>
<header class="aui-bar aui-bar-nav" style="padding-top:25px;background-color:#C81300;" id="header">
    <a class="aui-pull-left" tapmode="active" onclick="history.go(-1)"> <span class="aui-iconfont aui-icon-tu"> </span>
    </a>
</header>
<div class="activity">
    <div class="upOrDown">
        <div class="upOrDown_data">
            {if(!empty($lists))}
            {volist name='lists' id='va'}
            <div class="activityDetails flex-wrap underLine" onclick="fnActive(this)" tapmode='active'
                 data-id="{$va.id}">
                <div class="activityImg"><img src="{$va.activity_img}" class="showImg"></div>
                <div class="activityContent flex-con">
                    <div class="activityTitle aui-ellipsis-1">{$va.activity_name}</div>
                    <div class="box">
                        <div class="logo1"></div>
                        <div class="destination aui-ellipsis-1">{$va.activity_address}</div>
                    </div>
                    <div class="box">
                        <div class="logo2"></div>
                        <div class="activityTime aui-ellipsis-1 ">{$va.activity_start_time}至{$va.activity_end_time}
                        </div>
                    </div>

                    <div class="report">
                        <div class="reportDetail">{$va.activity_type_name}</div>
                        <div class="signUp">
                            <img src="__IMG__xian.png" alt="" class="xian">
                            <span>
					        {if $va.activity_status == 1}
                            报名未开始
                            {/if}
                            {if $va.activity_status == 2}
                            报名中
                            {/if}
                            {if $va.activity_status == 3}
                            进行中
                            {/if}
                            {if $va.activity_status == 4}
                            已结束
                            {/if}
                            {if $va.activity_status == 5}
                            活动未开始
                            {/if}
				        </span>
                        </div>
                    </div>
                </div>
            </div>
            {/volist}
            {/if}
        </div>
    </div>
</div>
<input type="hidden" name="mechanism_id" value="{$mechanism_id}">
</body>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__dropload.min.js"></script>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript" src="__JS__swiper.min.js"></script>
<script type="text/javascript">
    window.onload = function () {
        var swiper = new Swiper('.swiper-container', {
            slidesPerView: 'auto',
            // spaceBetween: 20,
            loop: true,
            autoplay: 3000,
            autoplayDisableOnInteraction: false,
            pagination: '.swiper-pagination',
        });
    };
    //活动详情
    function fnActive(el) {
        var activity_id = $api.attr(el, 'data-id');
        location.href = '{:url("First/activitydatail")}?activity_id=' + activity_id;
    }

    var page = 1;
    var mechanism_id = $("input[name='mechanism_id']").val();

    /**
     * 上拉加载，下拉刷新
     */
    var dropload = $('.upOrDown').dropload({
        scrollArea: window,
        autoLoad: true,
//        domUp : {
//            domClass   : 'dropload-up',
//            domRefresh : '<div class="dropload-refresh">↓下拉刷新-自定义内容</div>',
//            domUpdate  : '<div class="dropload-update">↑释放更新-自定义内容</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中-自定义内容...</div>'
//        },
//        domDown : {
//            domClass   : 'dropload-down',
//            domRefresh : '<div class="dropload-refresh">刷新</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
//            domNoData  : '<div class="dropload-noData">无数据</div>'
//        },
        loadDownFn: function (me) {
            page++;
            $.ajax({
                url: '{:url("Mechanism/ajaxMechanismActivity")}',
                data: {page: page, mechanism_id: mechanism_id},//
                type: 'POST',
                dataType: 'JSON',
                success: function (data) {
                    var arrLen = data.msg.length;
                    if (arrLen <= 0) {

                        me.lock();
//                         无数据
                        me.noData(true);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    } else {
                        var datas = data.msg;
                        $.each(datas, function (key, v) {
                            var str = '';
                            if (v.activity_status == 1) {
                                str = '报名未开始';
                            } else if (v.activity_status == 2) {
                                str = '报名中';
                            } else if (v.activity_status == 3) {
                                str = '进行中';
                            } else if (v.activity_status == 4) {
                                str = '已结束';
                            } else {
                                str = '活动未开始';
                            }


                            var _html = '';
                            _html += '<div class="activityDetails flex-wrap underLine" onclick="fnActive(this)" tapmode="active" data-id=' + v.id + '>';
                            _html += '<div class="activityImg"><img src=' + v.activity_img + ' class="showImg"></div>';
                            _html += '<div class="activityContent flex-con">';
                            _html += '<div class="activityTitle aui-ellipsis-1">' + v.activity_name + '</div>';
                            _html += '<div class="box">';
                            _html += '<div class="logo1"></div>';
                            _html += '<div class="destination aui-ellipsis-1">' + v.activity_address + '</div>';
                            _html += '</div>';
                            _html += '<div class="box">';
                            _html += '<div class="logo2"></div>';
                            _html += '<div class="activityTime aui-ellipsis-1 ">' + v.activity_start_time + '至' + v.activity_end_time + '</div>';
                            _html += '</div>';
                            _html += '<div class="report">';
                            _html += '<div class="reportDetail">' + v.activity_type_name + '</div>';
                            _html += '<div class="signUp">';
                            _html += '<img src="__IMG__xian.png" alt="" class="xian">';
                            _html += '<span>' + str + '</span>';
                            _html += '</div></div></div></div>';
                            $(".upOrDown_data").append(_html);

                        });
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }
                },
                error: function (xhr, type) {
                    alert('Ajax error!');
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        },
        loadUpFn: function (me) {
            page = 1;
            $.ajax({
                url: '{:url("Mechanism/ajaxMechanismActivity")}',
                data: {page: page, mechanism_id: mechanism_id},
                type: 'POST',
                dataType: 'json',
                success: function (data) {
                    $('.upOrDown_data').empty();//
                    var datas = data.msg;
                    $.each(datas, function (key, v) {
                        var str = '';
                        if (v.activity_status == 1) {
                            str = '未开始';
                        }else if (v.activity_status == 2) {
                            str = '报名中';
                        }else if (v.activity_status == 3) {
                            str = '进行中';
                        }else if (v.activity_status == 4) {
                            str = '已结束';
                        }else {
                            str = '活动未开始';
                        }



                        var _html = '';
                        _html += '<div class="activityDetails flex-wrap underLine" onclick="fnActive(this)" tapmode="active" data-id=' + v.id + '>';
                        _html += '<div class="activityImg"><img src=' + v.activity_img + ' class="showImg"></div>';
                        _html += '<div class="activityContent flex-con">';
                        _html += '<div class="activityTitle aui-ellipsis-1">' + v.activity_name + '</div>';
                        _html += '<div class="box">';
                        _html += '<div class="logo1"></div>';
                        _html += '<div class="destination aui-ellipsis-1">' + v.activity_address + '</div>';
                        _html += '</div>';
                        _html += '<div class="box">';
                        _html += '<div class="logo2"></div>';
                        _html += '<div class="activityTime aui-ellipsis-1 ">' + v.activity_start_time + '至' + v.activity_end_time + '</div>';
                        _html += '</div>';
                        _html += '<div class="report">';
                        _html += '<div class="reportDetail">' + v.activity_type_name + '</div>';
                        _html += '<div class="signUp">';
                        _html += '<img src="__IMG__xian.png" alt="" class="xian">';
                        _html += '<span>' + str + '</span>';
                        _html += '</div></div></div></div>';
                        $(".upOrDown_data").append(_html);
                    });
                    me.resetload();
                    me.unlock();
                    me.noData(false);
                },
                error: function (xhr, type) {
                    alert('Ajax error!');
                    me.resetload();
                }
            });
        }
    });
</script>

</html>
